package ui;

import java.awt.Color;
import java.awt.Font;

import javax.swing.BorderFactory;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JPasswordField;
import javax.swing.JTextField;

import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;

public class UserWithdraw extends JPanel {


	JPasswordField withPasswordfield;
	JButton withdrawconfirmButton;
	JTextField amountTextfield;
	       

	public UserWithdraw() {
		
		setBackground(Color.decode("#FFFFFF"));
		setLayout(null);
		
	    ImageIcon adminPanelGradient = new ImageIcon("gfx/adminPanelGradient.png");

		JLabel topPanel = new JLabel(adminPanelGradient);	
		topPanel.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, Color.decode("#CCCCCC")));
		topPanel.setBounds(0, 0, 650, 80);
		
		// Title
		
		JLabel panelTitle = new JLabel("Withdraw");
		panelTitle.setBounds(10, 35, 650, 50);
		panelTitle.setFont(new Font("Helvetica Neue", Font.PLAIN, 28));
		
		//Withdrawal Textfield Label
		JLabel amountLabel = new JLabel("Amount of Withdrawal");
		amountLabel.setFont(new Font("Arial", Font.PLAIN, 16));
		amountLabel.setBounds(230,200,160,20);
			
		// Amount Textfield
		amountTextfield = new JTextField();
		amountTextfield.setFont(new Font("Arial", Font.PLAIN, 13));
		amountTextfield.setBounds(225,225,200,30);
		
		
		//Password Textfield Label
		JLabel passwordLabel = new JLabel("Password");
		passwordLabel.setFont(new Font("Arial", Font.PLAIN, 16));
		passwordLabel.setBounds(230,275,160,20);
			
		// Password Textfield
		withPasswordfield = new JPasswordField();
		withPasswordfield.setFont(new Font("Arial", Font.PLAIN, 13));
		withPasswordfield.setBounds(225,300,200,30);
		
	
	
		//Confirm Button
		withdrawconfirmButton = new JButton("Confirm");
		withdrawconfirmButton.setBounds(275,350,100,30);	
		withdrawconfirmButton.setFont(new Font("Arial", Font.PLAIN, 13));
		withdrawconfirmButton.setActionCommand("WithdrawConfirm");
			
			
		
		
			
		// ADDING ELEMENTS
		add(withPasswordfield);
		add(passwordLabel);
		add(amountTextfield);
		add(withdrawconfirmButton);
		add(panelTitle);
		add(topPanel);
		add(amountLabel);
	}

	public JPasswordField getWithPasswordfield() {
		return withPasswordfield;
	}

	public JTextField getAmountTextfield() {
		return amountTextfield;
	}

	public void addACList(ActionListener ac){
		withdrawconfirmButton.addActionListener(ac);
		
		
	}

}
